<template>
  <svg aria-hidden="true" :width="size" :height="size">
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<script lang="ts" setup>
  defineOptions({
    name: 'SvgIcon'
  })

  const props = defineProps({
    prefix: {
      type: String,
      default: 'k'
    },
    name: {
      type: String,
      required: true
    },
    color: {
      type: String,
      default: '#333'
    },
    size: {
      type: [Number, String],
      default: 24
    }
  })
  const symbolId = computed(() => `#${props.prefix}-${props.name}`)
</script>
